These are used in hot paths, e.g. widget construction.
GtkWidget *widget)
{
GtkShortcutController *self = GTK_SHORTCUT_CONTROLLER (controller);
- int i;
+ guint i, p;
GTK_EVENT_CONTROLLER_CLASS (gtk_shortcut_controller_parent_class)->set_widget (controller, widget);
- for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (controller)); i++)
+ for (i = 0, p = g_list_model_get_n_items (G_LIST_MODEL (controller)); i < p; i++)
{
GtkShortcut *shortcut = g_list_model_get_item (G_LIST_MODEL (controller), i);
update_accel (shortcut, widget, TRUE);
else
{
GListModel *parent_shortcuts = G_LIST_MODEL (priv->shortcuts);
- guint i;
+ guint i, p;
priv->shortcuts = g_list_store_new (GTK_TYPE_SHORTCUT);
- for (i = 0; i < g_list_model_get_n_items (parent_shortcuts); i++)
+ for (i = 0, p = g_list_model_get_n_items (parent_shortcuts); i < p; i++)
{
GtkShortcut *shortcut = g_list_model_get_item (parent_shortcuts, i);
g_list_store_append (priv->shortcuts, shortcut);